package cn.itcast.mapper;

import cn.itcast.pojo.district;
import cn.itcast.pojo.districtExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;

public interface districtMapper {
    int countByExample(districtExample example);

    int deleteByExample(districtExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(district record);

    int insertSelective(district record);

    List<district> selectByExample(districtExample example);

    district selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") district record, @Param("example") districtExample example);

    int updateByExample(@Param("record") district record, @Param("example") districtExample example);

    int updateByPrimaryKeySelective(district record);

    int updateByPrimaryKey(district record);

    /**
     * 根据区域名称获取该区域
     * @param districtName
     * @return
     */
    district getByDistrictName(String districtName);

    /**
     * 根据pid查询所有的子区域信息
     * @param pid
     * @return
     */
    List<district> getChildrenDistrict(Integer pid);

    /**
     * 开通区域
     * @param districtSqe
     * @return
     */
    int openDistrict(String districtSqe);

    /**
     * 关闭区域
     * @param districtSqe
     * @return
     */
    int closeDistrict(String districtSqe);

    /**
     * 根据id查询区域信息
     * @param id
     * @return
     */
    district getDistrictById(Integer id);




}